/*
 * @Descripttion: 文件说明
 * @version: V1.0
 * @Author: GW
 * @Date: 2021-07-29 10:40:41
 * @LastEditors: GW
 * @LastEditTime: 2021-09-25 09:47:53
 */
import { axios } from "../utils/request";
// import qs from "qs";

const api = {
    PageList: "/dictData/system/page",
    Save: "/dictData/system/saveOrUpdate",
    Disable: "/dictData/system/disable",             //停用
    Enable: "/dictData/system/enable",              //启用
    Delete: "/dictData/system/delete",
    getAllUrl: "/dictType/getDictDataAll",          //获取所有字典数据
};
/**
 * 获取列表
 * parameter: {
 *     dictTypeId: 1,
 *     dictLabel: '',        //字典标签
 *     dictValue: '',        //字典键值
 *     isSys: null,         //是否系统字典     
 *     status: 0            //状态（0正常 1删除 2停用）
 * }
 * @param parameter
 * @returns {*}
 */
export function keyList (parameter) {
    return axios({
        url: api.PageList,
        method: "get",
        params: parameter
    });
};

/**
 * 新增/编辑
 * @param {*} data
 */
export function keySave (data) {
    return axios({
        url: api.Save,
        method: "post",
        data: data
        // headers: {
        //   'Content-Type': 'application/json;charset=UTF-8'
        // }
    });
};

/**
 * 删除
 * @param {*} parameter 
 */
export function keyDelete (parameter) {
    return axios({
        url: api.Delete,
        method: "DELETE",
        params: parameter
    });
};


/**
 * 启动
 * @param {*} parameter
 */
export function keyEnable (parameter) {
    return axios({
        url: api.Enable,
        method: "put",
        params: parameter

    });
};

/**
 * 禁用
 * @param {*} data
 */
export function keyDisable (parameter) {
    return axios({
        url: api.Disable,
        method: "put",
        params: parameter

    });
};
//获取所有字典数据

export function getAllDict (data) {
    return axios({
        url: api.getAllUrl,
        method: "get",
        params: data
    });
};
